﻿using Dapper.Contrib.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoFlatnessTest.Db
{

    /// <summary>
    /// 项目
    /// </summary>
    [Table("Project")]
    public class Project
    {
        /// <summary>
        /// ID
        /// </summary>
        [Key]
        public string Id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 行数
        /// </summary>
        public int? RowNum { get; set; }
        /// <summary>
        /// 列数
        /// </summary>
        public int? ColumnNum { get; set; }
        /// <summary>
        /// 主页显示(1显示)
        /// </summary>
        public int? HomeShow { get; set; }
        /// <summary>
        /// 是否扫码（1是）
        /// </summary>
        public int? IsSma { get; set; }
        /// <summary>
        /// 是否Check过站管控（1是）
        /// </summary>
        public int? IsCheck { get; set; }
        /// <summary>
        /// 通过值（芯片）。原意义：通过警告值
        /// </summary>
        public decimal? OkValWarn { get; set; }
        /// <summary>
        /// 通过值
        /// </summary>
        public decimal? OkVal { get; set; }
        /// <summary>
        /// 单次宽度
        /// </summary>
        public int? OneWidth { get; set; }
        /// <summary>
        /// 单次运载起点
        /// </summary>
        public int? OneYz1 { get; set; }
        /// <summary>
        /// 单次运载终点
        /// </summary>
        public int? OneYz2 { get; set; }
        /// <summary>
        /// 单次扫描起点
        /// </summary>
        public int? OneSmi1 { get; set; }
        /// <summary>
        /// 单次扫描终点
        /// </summary>
        public int? OneSmi2 { get; set; }
        /// <summary>
        /// 单次扫码起点
        /// </summary>
        public int? OneSma1 { get; set; }
        /// <summary>
        /// 单次扫码终点
        /// </summary>
        public int? OneSma2 { get; set; }
        /// <summary>
        /// 连续运载起点
        /// </summary>
        public int? TwoYz1 { get; set; }
        /// <summary>
        /// 连续运载终点
        /// </summary>
        public int? TwoYz2 { get; set; }
        /// <summary>
        /// 连续扫描起点
        /// </summary>
        public int? TwoSmi1 { get; set; }
        /// <summary>
        /// 连续扫描终点
        /// </summary>
        public int? TwoSmi2 { get; set; }
        /// <summary>
        /// 连续扫码起点
        /// </summary>
        public int? TwoSma1 { get; set; }
        /// <summary>
        /// 连续扫码终点
        /// </summary>
        public int? TwoSma2 { get; set; }
        /// <summary>
        /// 排序码
        /// </summary>
        public int? Sort { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdatedTime { get; set; }
    }

    /// <summary>
    /// 测试记录
    /// </summary>
    [Table("TestRecord")]
    public class TestRecord
    {
        /// <summary>
        /// ID
        /// </summary>
        [ExplicitKey]
        public string Id { get; set; }
        /// <summary>
        /// 项目Id
        /// </summary>
        public string ProjectId { get; set; }
        /// <summary>
        /// 项目名称
        /// </summary>
        public string ProjectName { get; set; }
        /// <summary>
        /// 组ID(同个测试周期)
        /// </summary>
        public string GuidId { get; set; }
        /// <summary>
        /// 模式(1标准2快速3校准4单板测试10录入20抽测)
        /// </summary>
        public int Mode { get; set; }
        /// <summary>
        /// 工单
        /// </summary>
        public string WorkOrder { get; set; }
        /// <summary>
        /// 行号(原点为右下)
        /// </summary>
        public int? RowNum { get; set; }
        /// <summary>
        /// 列号(原点为右下)
        /// </summary>
        public int? ColumnNum { get; set; }
        /// <summary>
        /// 编号(原点为右下)
        /// </summary>
        public int? TestNum { get; set; }
        /// <summary>
        /// 通过(1通过)
        /// </summary>
        public int? IsOk { get; set; }
        /// <summary>
        /// 扫描相似度
        /// </summary>
        public decimal? MiSimi { get; set; }
        /// <summary>
        /// 扫描最大值
        /// </summary>
        public decimal? MiMaxVal { get; set; }
        /// <summary>
        /// 扫描最小值
        /// </summary>
        public decimal? MiMinVal { get; set; }
        /// <summary>
        /// 扫描差值
        /// </summary>
        public decimal? MiVal { get; set; }
        /// <summary>
        /// 扫描原始信息
        /// </summary>
        public string MiInfo { get; set; }
        /// <summary>
        /// 扫码原始信息
        /// </summary>
        public string MaInfo { get; set; }
        /// <summary>
        /// 是否同步(1否)
        /// </summary>
        public int? IsSync { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }
    }

    /// <summary>
    /// 标定测试记录
    /// </summary>
    [Table("DemaRecord")]
    public class DemaRecord
    {
        /// <summary>
        /// ID
        /// </summary>
        [ExplicitKey]
        public string Id { get; set; }
        /// <summary>
        /// 编号(1-5)
        /// </summary>
        public int? TestNum { get; set; }
        /// <summary>
        /// 通过(1通过)
        /// </summary>
        public int? IsOk { get; set; }
        /// <summary>
        /// 扫描相似度
        /// </summary>
        public decimal? MiSimi { get; set; }
        /// <summary>
        /// 扫描最大值
        /// </summary>
        public decimal? MiMaxVal { get; set; }
        /// <summary>
        /// 扫描最小值
        /// </summary>
        public decimal? MiMinVal { get; set; }
        /// <summary>
        /// 扫描差值
        /// </summary>
        public decimal? MiVal { get; set; }
        /// <summary>
        /// 扫描原始信息
        /// </summary>
        public string MiInfo { get; set; }
        /// <summary>
        /// 是否同步(1否)
        /// </summary>
        public int? IsSync { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }
    }
}
